﻿namespace samples.domain.Entities
{
    public class Order
    {
        public int Id { get; private set; }
        /// <summary>
        /// 客户id
        /// </summary>
        public int CustomerId { get; private set; }
        /// <summary>
        /// 客户姓名
        /// </summary>
        public string CustomerName { get; private set; }
        /// <summary>
        /// 客户电话
        /// </summary>
        public string CustomerMobile { get; private set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; private set; }
        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal TotalAmount { get; private set; }
        /// <summary>
        /// 订单商品
        /// </summary>
        private List<OrderLine> lines = new List<OrderLine>();
        /// <summary>
        /// 订单商品
        /// </summary>
        public IReadOnlyList<OrderLine> Lines => lines;

        public Order()
        {
            
        }

        public Order(int customerId, string customerName, string customerMobile, string remarks, decimal totalAmount)
        {
            CustomerId = customerId;
            CustomerName = customerName;
            CustomerMobile = customerMobile;
            Remarks = remarks;
            TotalAmount = totalAmount;
        }
    }
}
